package com.seele.tigerwallet.model;

import android.text.TextUtils;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
import com.seele.tigerwallet.ui.utils.BaseUtil;

import java.io.Serializable;


@DatabaseTable(tableName = "t_contacts")
public class ContactsModel implements Serializable {


    @DatabaseField(generatedId = true, columnName = "id")
    public int _id;

    /**
     * firstname : F
     * lastname : L
     * toaddr : 0x4af87cce9749b5b98c409850af084b4c83451197
     * phone : 15689754897
     * mail : 510205558@qq.com
     * note : note
     */
    @DatabaseField(columnName = "contactsId")
    public int id;


    @DatabaseField(columnName = "firstname")
    public String firstname;

    @DatabaseField(columnName = "lastname")
    public String lastname;

    @DatabaseField(columnName = "toaddr")
    public String toaddr;

    @DatabaseField(columnName = "phone")
    public String phone;

    @DatabaseField(columnName = "mail")
    public String mail;

    @DatabaseField(columnName = "note")
    public String note;

    @DatabaseField(columnName = "address")
    public String address;




    public String getFirstname() {
        return BaseUtil.getFromBase64(firstname);
    }


    public String getLastname() {
        return BaseUtil.getFromBase64(lastname);
    }

    public String getMail() {
        return BaseUtil.getFromBase64(mail);
    }


    public String getNote() {
        return BaseUtil.getFromBase64(note);
    }

    public String getToaddr() {
        if (TextUtils.isEmpty(toaddr)) {
            return " ";
        }
        return toaddr;
    }
}
